import request from '@/utils/request'


/**
 * 
 * 
 * @description 文件分类
 */


//列表
export function findList(data) {
  return request({
    method: 'post',
    url: '/leaveQuery/getBaseRecordListView',
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    //设置请求头
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data
  })
}

//出国境列表
export function cgjfindList(data) {
  return request({
    method: 'post',
    url: '/abroadQuery/getAbroadListView',
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    //设置请求头
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data
  })
}

//详情
export function findOne(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveQuery/getRecord',
    method: 'post',
    params: {},
    data: data
  })
}
//详情 出国境
export function cgjfindOne(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/abroadQuery/abroadDetail',
    method: 'post',
    params: {},
    data: data
  })
}
//流程
export function getTaskAuditList(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/process/getTaskAuditList',
    method: 'post',
    params: {},
    data: data
  })
}

//增 请休假
export function ADD_FILE_TYPE(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveApply/insert',
    method: 'post',
    params: {},
    data: data
  })
}


//增 请休假  待录入
export function WRITE_ADD_FILE_TYPE(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveApply/insertWithOutAudit',
    method: 'post',
    params: {},
    data: data
  })
}



//update
export function update(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveApply/update',
    method: 'post',
    params: {},
    data: data
  })
}
//暂存
export function Temporary_storage(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveApply/insertDraft',
    method: 'post',
    params: {},
    data: data
  })
}

//暂存 待录入暂存
export function WRITE_Temporary_storage(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveApply/insertDraftWithOutAudit',
    method: 'post',
    params: {},
    data: data
  })
}


//查
export function EDIT_SMS_TEMPLATE_BY_ID(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: 'api/v1/smsTemplate/findSmsTemplateById/' + data,
    method: 'post',
    params: {},
    data: ''
  })
}


//改

export function EDIT_FILE_TYPE(data) {
  return request({
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    transformRequest: [function (data) {
      data = JSON.stringify(data)
      return data
    }],
    url: 'api/v1/type/updateFileType',
    method: 'post',
    params: {},
    data: data
  })
}

//删
export function DEL_FILE_TYPE(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: 'api/v1/type/delFileTypeById/' + data,
    method: 'post',
    params: {},
    data: ''
  })
}


//校验是否通过
export function Check(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/checkApi/leaveBeforeCheck',
    method: 'post',
    params: {},
    data: data
  })
}

//查询休假时间以及剩余假期
export function myLeaveStatistics(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/recordStatistics/myLeaveStatistics',
    method: 'post',
    params: {},
    data: data
  })
}

//保存时检验
export function checkApi(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/checkApi/leaveVerification',
    method: 'post',
    params: {},
    data: data
  })
}


//请休假审批
export function approval(data) {
  return request({
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    //转换数据的方法
    transformRequest: [
      function (data) {
        let ret = '';
        for (let it in data) {
          ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
        }
        return ret;
      }
    ],
    url: '/leaveAudit/recordAudit',
    method: 'post',
    params: {},
    data: data
  })
}



